<!DOCTYPE html>
  <!--[if lt IE 7]>
    <html class="lt-ie9 lt-ie8 lt-ie7" lang="en">
  <![endif]-->

  <!--[if IE 7]>
    <html class="lt-ie9 lt-ie8" lang="en">
  <![endif]-->

  <!--[if IE 8]>
    <html class="lt-ie9" lang="en">
  <![endif]-->

  <!--[if gt IE 8]>
    <!-->
    <html lang="en">
    <!--
  <![endif]-->

 
<head>
    <meta charset="utf-8">
    <title>LSS Admin</title>
    <meta name="author" content="Srinu Basava">
    <meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
    <meta name="description" content="StartUp Admin UI">
    <meta name="keywords" content="Think2do Admin UI, Admin UI, Admin Dashboard, Best admin UI, Best backend UI, Best Dashboard, Responsive admin UI, Responsive dashboard, Responsive Backend, Mobile admin, Mobile Backend, Mobile Dashboard">
    <script src="<?php echo Yii::app()->baseUrl."/assets/js/html5-trunk.js"?>"></script>
    <link href="<?php echo Yii::app()->baseUrl."/assets/icomoon/style.css"?>" rel="stylesheet">
    <!--[if lte IE 7]>
    <script src="<?php echo Yii::app()->baseUrl."/assets/css/icomoon-font/lte-ie7.js"?>"></script>
    <![endif]-->

    <!-- NVD graphs css -->
    <link href="<?php echo Yii::app()->baseUrl."/assets/css/nvd-charts.css"?>" rel="stylesheet">

    <!-- Bootstrap css -->
    <link href="<?php echo Yii::app()->baseUrl."/assets/css/main.css"?>" rel="stylesheet">

    <script src="<?php echo Yii::app()->baseUrl."/assets/js/jquery.min.js"?>"></script>
    <script src="<?php echo Yii::app()->baseUrl."/assets/js/bootstrap.js"?>"></script>
    <script src="<?php echo Yii::app()->baseUrl."/assets/js/moment.js"?>"></script>






    <!-- Custom Js -->
    <script src="<?php echo Yii::app()->baseUrl."/assets/js/custom-index.js"?>"></script>
    <script src="<?php echo Yii::app()->baseUrl."/assets/js/custom-calendar.js"?>"></script>

    <script src="<?php echo Yii::app()->baseUrl."/assets/js/theming.js"?>"></script>
    <script src="<?php echo Yii::app()->baseUrl."/assets/js/custom.js"?>"></script>
    <script src="<?php echo Yii::app()->baseUrl."/assets/js/jquery.timer.js"?>"></script>

 
  </head>
  <body>
    <header>
      <a href="www.thinktodo.net" class="logo">Think2do</a>
      <div id="mini-nav">
        <ul class="hidden-phone">
          <li>
            <a href="#documentation" data-toggle="modal" data-original-title="">
              Documentation
            </a>
            <div id="documentation" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                  ×
                </button>
                <h4 id="myModalLabel1">
                  Full html documentation is available on purchase.
                </h4>
              </div>
              <div class="modal-body">
                <img src="<?php echo Yii::app()->baseUrl."/assets/img/documentation.png"?>" />
              </div>
            </div>
          </li>
          <li class="dropdown">
            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
              Theming
              <span class="caret icon-white"></span>
            </a>
            <ul class="dropdown-menu pull-right">
              <li>
                <a href="#" id="default">Default</a>
              </li>
              <li>
                <a href="#" id="facebook">Facebook</a>
              </li>
              <li>
                <a href="#" id="foursquare">Foursquare</a>
              </li>
              <li>
                <a href="#" id="google-plus">Google+</a>
              </li>
              <li>
                <a href="#" id="instagram">Instagram</a>
              </li>
              <li>
                <a href="#" id="whitesmoke">White Smoke</a>
              </li>
              <li>
                <a href="#" id="grey">Grey</a>
              </li>
            </ul>
          </li>
          <li>
            <a href="faq.html"><span class="fs1" aria-hidden="true" data-icon="&#xe03b;"></span></a>
          </li>
          <li>
            <a href="profile.html"><span class="fs1" aria-hidden="true" data-icon="&#xe090;"></span></a>
          </li>
          <li>
            <a href="login.html"><span class="fs1" aria-hidden="true" data-icon="&#xe0b1;"></span></a>
          </li>
        </ul>
        <div class="clearfix"></div>
      </div>
    </header>
    <div class="container-fluid">
      <div class="left-sidebar hidden-tablet hidden-phone">
        <div class="user-details">
          <div class="user-img">
            <img src="<?php echo Yii::app()->baseUrl."/assets/img/user-avatar.png"?>" class="avatar" alt="Avatar">
          </div>
          <div class="welcome-text">
            <span>Welcome</span>
            <p class="name"><?php echo Yii::app()->session['name']; ?></p>
          </div>
        </div>
        <div class="content">
          <div id="accordion1" class="accordion no-margin">
            <div class="accordion-group">
              <div class="accordion-heading">
                <a href="#collapseSeven" data-parent="#accordion1" data-toggle="collapse" class="accordion-toggle">
                  Nhóm <span class="label info-label label-important"></span>
                </a>
              </div>
              <div class="accordion-body in collapse" id="collapseSeven" style="height: auto;">
                <div class="accordion-inner">

                </div>
              </div>
            </div>

          </div>
        </div>
 
      </div>
      <div class="dashboard-wrapper">
        <div id="main-nav" class="hidden-phone hidden-tablet">
          <ul>
            <li>
              <a href="admin" class="selected">
                <span class="fs1" aria-hidden="true" data-icon="&#xe0a0;"></span> Bản đồ
              </a>
            </li>
            <li>
              <a href="report">
                <span class="fs1" aria-hidden="true" data-icon="&#xe097;"></span> Báo cáo
              </a>
            </li>
            
     
           
            
           
          </ul>
          <div class="clearfix"></div>
        </div>

        <div class="main-container">

			<?php echo $content; ?>
        </div>
      </div><!-- dashboard-container -->
    </div><!-- container-fluid -->
  </body>
    <script type="text/javascript">
       try{
           if($("#map-canvas")==null){
            var timer = $.timer(function() {

               $.ajax({
                                    type: "POST",
                                    data: { group_id: <?php echo Yii::app()->session['group_id'] ?>},
                                    url: "<?php echo Yii::app()->baseUrl."/index.php/ajax/getLocation"?>",
                                        beforeSend: function( xhr ) {
                                            xhr.overrideMimeType( "text/plain; charset=utf-8" );
                                            }
                                    } )
                .done(function(data) {
                    try{
                        var json = jQuery.parseJSON( data );
                        var group;
                        //show group
                        if(json.data.length>0){
                            $('span.label.info-label.label-important').text(json.data.length);
                            group='<div class="accordion-inner"><ul class="signups">';
                            
                        }else{
                            $('span.label.info-label.label-important').hide();
                        }  
                        //create html for group
                        var path='<?php echo Yii::app()->baseUrl?>';
                        for(var i=0;i<json.data.length;i++){
                          var user='<li><div class="user pull-left"><img src="'+path+'/assets/img/avatar-8.png" alt="user" >'+
                          '</div><div class="info"><h6>'+json.data[i].name+'</h6><p class="designation">'+json.data[i].location+'</p></div></li>';
                          group=group+user;
                        }
                        if(json.data.length>0){                  
                            group=group+'</ul></div>'; 
                            $('#collapseSeven').html(group);
                        }else{
                            
                        }
                        
                    }catch(e){
                        alert(e);
                    }

                })
                .fail(function(error) {
                   // alert( error );
                })
                .always(function() {
                    //alert( "complete" );
                });



            });               
               
                var jqxhr = $.ajax({
                                    type: "POST",
                                    data: { group_id: <?php echo Yii::app()->session['group_id'] ?>},
                                    url: "<?php echo Yii::app()->baseUrl."/index.php/ajax/getLocation"?>",
                                        beforeSend: function( xhr ) {
                                            xhr.overrideMimeType( "text/plain; charset=utf-8" );
                                            }
                                    } )
                .done(function(data) {
                        var json = jQuery.parseJSON( data );
                        var group;
                        //show group
                        if(json.data.length>0){
                            $('span.label.info-label.label-important').text(json.data.length);
                            group='<div class="accordion-inner"><ul class="signups">';
                            
                        }else{
                            $('span.label.info-label.label-important').hide();
                        }
                        //create html for group
                        var path='<?php echo Yii::app()->baseUrl?>';
                        
                        for(var i=0;i<json.data.length;i++){
                            var myLatLng = new google.maps.LatLng(json.data[i].lat, json.data[i].lng);
                            
                            var user='<li><div class="user pull-left"><img src="'+path+'/assets/img/avatar-8.png" alt="user" >'+
                            '</div><div class="info"><h6>'+json.data[i].name+'</h6><p class="designation">'+json.data[i].location+'</p></div></li>';
                            group=group+user;
                        }
                        
                        if(json.data.length>0){                  
                            group=group+'</ul></div>'; 
                            $('#collapseSeven').html(group);
                        }else{
                            
                        }
                        timer.set({ time : 15000, autostart : true });
                })
                .fail(function() {
                    //alert( "fail" );
                })
                .always(function() {
                    //alert( "complete" );
                });                
        
             } 
            }catch(e){
                alert(e);
            }
    </script>

    

</html>